﻿using iMES.Core.Utilities;
using iMES.Entity.DomainModels;
using iMES.Inventory.IRepositories;
using iMES.Inventory.IServices;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Text;

namespace iMES.Inventory.Services
{
    public partial class View_StoreDetailsServices
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly IView_StoreDetailsRepositories storeDetailsRepositories;


        [ActivatorUtilitiesConstructor]
        public View_StoreDetailsServices(
            IView_StoreDetailsRepositories dbRepository,
            IHttpContextAccessor httpContextAccessor
            )
        : base(dbRepository)
        {
            _httpContextAccessor = httpContextAccessor;
            storeDetailsRepositories = dbRepository;
        }

        WebResponseContent WebResponseContent = new WebResponseContent();


        public override WebResponseContent Del(object[] keys, bool delList = false)
        {
            base.DelOnExecuted = (object[] defectItemIds) =>
            {
                return new WebResponseContent(true) { Status = true };
            };

            return base.Del(keys, delList);
        }


        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="saveModel"></param>
        /// <returns></returns>
        public override WebResponseContent Update(SaveModel saveModel)
        {
            UpdateOnExecuting = (Invent_StoreDetails Store, object addlist, object updatelist, List<object> keys) =>
            {
                return WebResponseContent.OK();
            };
            base.UpdateOnExecuted = (Invent_StoreDetails entity, object obj1, object obj2, List<object> list) =>
            {
                return new WebResponseContent(true);
            };
            return base.Update(saveModel);
        }

    }
}
